package simple.demo.springintegration.demo.chapter5.component;

import org.springframework.integration.MessageChannel;
import org.springframework.integration.annotation.ServiceActivator;
import org.springframework.integration.support.MessageBuilder;

public class SimpleHandler2 {
	
	private MessageChannel channel;
	
	public void setChannel(MessageChannel channel) {
		this.channel = channel;
	}
	
	@ServiceActivator
	public void handleMessage(String msg) {
		channel.send(MessageBuilder.withPayload(msg).build());
	}
	
}
